package com.tgra;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.GL11;
import com.badlogic.gdx.graphics.Texture;

public class Cell
{
	public boolean westWall;
	public boolean southWall;
	public Cube sides;
	
	public Cell (boolean westWall, boolean southWall, Texture tex, Texture tex2)
	{
		this.westWall = westWall;
		this.southWall = southWall;
		sides = new Cube(tex, tex2);
	}
	public void draw(boolean endLength, boolean endWidth)
	{
		Gdx.gl11.glEnable(GL11.GL_NORMALIZE);
		if(endLength == true)
		{
			this.westWall = false;
		}
		if(endWidth == true)
		{
			this.southWall = false;
		}
		if(endLength != true && endWidth != true)
		{
			drawFloor();
		}
		if(this.southWall)
		{
			Gdx.gl11.glPushMatrix();
			Gdx.gl11.glTranslatef(0.5f, 0.5f, 0.0f);
			Gdx.gl11.glScalef(1.0f, 1.0f, 0.15f);
			sides.draw();
			Gdx.gl11.glPopMatrix();
		}
		if(this.westWall)
		{
			Gdx.gl11.glPushMatrix();
			Gdx.gl11.glTranslatef(0.0f, 0.5f, 0.5f);
			Gdx.gl11.glScalef(0.15f, 1.0f, 1.0f);
			sides.draw();
			Gdx.gl11.glPopMatrix();
		}
	}
	public void drawFloor()
	{
		Gdx.gl11.glPushMatrix();
		Gdx.gl11.glTranslatef(0.5f, 0.0f, 0.5f);
		Gdx.gl11.glScalef(1.0f, 0.05f, 1.0f);
		sides.drawFloor();
		Gdx.gl11.glPopMatrix();
	}

}
